<script type="text/javascript">

     
                     function datepicker() {
                           $( "#datepicker" ).datepicker({
                                    showOn: "button",
                                    buttonImage: "<?php echo base_url().
                                            'css/assets/sprites/calendar.gif'?>",
                                    buttonImageOnly: true
                            }); 
                    }           
                 
    function donothing()
    {
        alert("hello");
    }
    function ajax_formResult()
    {
        
        $.ajax({
                type: "POST",
                url: $("#form1").attr('action'),
                data: $("#form1").serialize(),
                dataType: 'json',
                success: function(json) {
                        
                        if (json.renderhtml)
                        {
                            
                           var res = json.renderhtml.toString();
                           $("div#ajax_result").html(res);
                           
                           
                        }
                        else
                        {
                           alert ("haduh");
                        }
                }
            });
            return false;
    }
    
    function ajax_formSubmit()
    {
        $.ajax({
                type: "POST",
                url: $("#form2").attr('action'),
                data: $("#form2").serialize(),
                dataType: 'json',
                success: function(json) {
                        if (json.renderhtml)
                        {
                           var res = json.renderhtml.toString();
                           if (res == 'oke')
                               {
                                   $("div#ajax_result_form").html("Input Data Success!");
                                   document.getElementById('input_ln').value = "";
                                   document.getElementById('input_af').value = "";
                                   document.getElementById('input_pl').value = "";
                                   document.getElementById('input_sl').value = "";
                                   document.getElementById('datepicker').value = "";
                               }
                               else {
                                   $("div#ajax_result_form").html(res);
                               }
                        }
                        else
                        {
                           alert ("haduh");
                        }
                }
            });
            return false;
    }
    
    function ajax_formSubmitEx()
    {
        $.ajax({
                type: "POST",
                url: $("#form3").attr('action'),
                data: $("#form3").serialize(),
                dataType: 'json',
                success: function(json) {
                        if (json.renderhtml)
                        {
                           var res = json.renderhtml.toString();
                           if (res == 'oke')
                               {
                                   $("div#ajax_result_form_ex").html("Input Data Success!");
                                   document.getElementById('input_st').value = "";
                                   document.getElementById('input_un').value = "";
                                   document.getElementById('input_cn').value = "";
                                   document.getElementById('input_sy').value = "";
                                   document.getElementById('input_ey').value = "";
                               }
                               else {
                                   $("div#ajax_result_form_ex").html(res);
                               }
                        }
                        else
                        {
                           alert ("haduh");
                        }
                }
            });
            return false;
    }
    
    function ajax_formSubmitAg()
    {
        alert('wew');
        $.ajax({
            
                type: "POST",
                url: $("#form4").attr('action'),
                data: $("#form4").serialize(),
                dataType: 'json',
                success: function(json) {
                        if (json.renderhtml)
                        {
                         alert('waaaaa');
                           var res = json.renderhtml.toString();
                           alert(res);
                           if (res == 'oke')
                               {
                                   $("div#ajax_result_form_ag").html("Input Data Success!");
                                   document.getElementById('input_en').value = "";
                                   document.getElementById('datepicker').value = "";
                                   document.getElementById('input_ip').value = "";
                                   document.getElementById('input_np').value = "";
                                   document.getElementById('input_ci').value = "";
                               }
                               else {
                                   $("div#ajax_result_form_ag").html(res);
                               }
                        }
                        else
                        {
                           alert ("haduh");
                        }
                }
            });
            return false;
    }
   
</script>


<div class="left-content">
<!--    <div class="addnew-tombol" onclick="ajax_formResult();">Add New Event </div>-->
    
    <div class="content-form">
    <form id="form1" method="post" action="<?php echo base_url().'index.php/eventman/controllerView'?>" >
        <p>Time Now <br/> <input class="txt_submit_disable" id="input_time" type="text" name="time_box1" value="<?php echo $time ?>" disabled="true" /> <br/></p>
        <p>Department <br/> <input class="txt_submit_disable" id="input_io" type="text" name="io_box1" value="<?php echo $nameDepart ?>" disabled="true"/> <br/>  </p>      
        <input type="hidden" name="name_value" value="<?php echo $username ?>" />
        <input type="hidden" name="time_value" value="<?php echo $sqltime ?>" />
        <input type="hidden" name="depart_value" value="<?php echo $idDepart ?>" />
        <p>
            Category <br/>
            <select name="tipe" onchange="ajax_formResult();">
                <option value="0" selected></option>
              <option value="lecture">Guest Lecturer</option>
              <option value="exchange">Student Exchange</option>
              <option value="agreement">International Agreement</option>
              <option value="event">International Event</option>
              <option value="research">International Joint Research</option>
            </select>
        </p>
        
    </form>
    </div>
</div>

<div id="ajax_result" class="right-content">
  
</div>



